<?php /* Smarty version 2.6.26, created on 2010-12-16 17:30:00
         compiled from customer/customer.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'sslash', 'customer/customer.html', 23, false),array('modifier', 'date_format', 'customer/customer.html', 28, false),array('modifier', 'escape', 'customer/customer.html', 137, false),array('modifier', 'regex_replace', 'customer/customer.html', 173, false),array('modifier', 'lower', 'customer/customer.html', 173, false),array('function', 'mailto', 'customer/customer.html', 39, false),array('function', 'math', 'customer/customer.html', 191, false),)), $this); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" lang="ru" xml:lang="ru"> 
    <head>
	<title>LocalCRM</title>
	<script src="js/jquery-1.4.2.min.js" type="text/javascript"></script>
	<script src="js/jquery-ui-1.8.4.custom.min.js" type="text/javascript"></script>
	<script src="js/jquery.blockUI.js" type="text/javascript"></script>
	<script src="js/crm/common.js" type="text/javascript"></script>
	<link href="css/redmond/jquery-ui-1.8.4.custom.css" rel="stylesheet" type="text/css"/>
    </head>
    <body>
	<div class="tabs">
	    <ul>
		<li><a href="#info">Карточка</a></li>
		<li><a href="#bank">Реквизиты</a></li>
		<li><a href="#contact">Контакты</a></li>
		<li><a href="#document">Документы</a></li>
	    </ul>
	    <div id="info">
		<table align="center" class="ui-widget">
		    <tr>
			<td align="right">Клиент:</td>
			<td colspan="3"><?php echo ((is_array($_tmp=$this->_tpl_vars['customer']['customer_name'])) ? $this->_run_mod_handler('sslash', true, $_tmp) : stripslashes($_tmp)); ?>
</td>
		    </tr>
		    <?php if ($this->_tpl_vars['contract'] != ''): ?>
		    <tr>
			<td align="right">Номер договора:</td>
			<td colspan="3"><strong><?php echo $this->_tpl_vars['contract']['contract_number']; ?>
</strong><?php if ($this->_tpl_vars['contract']['accepted_date'] != ''): ?> от <?php echo ((is_array($_tmp=$this->_tpl_vars['contract']['accepted_date'])) ? $this->_run_mod_handler('date_format', true, $_tmp, '%d.%m.%Y') : smarty_modifier_date_format($_tmp, '%d.%m.%Y')); ?>
<?php endif; ?></td>
		    </tr>
		    <?php endif; ?>
		    <?php if ($this->_tpl_vars['manager'] != ''): ?>
		    <tr>
			<td align="right">Ваш менеджер:</td>
			<td colspan="3"><?php echo $this->_tpl_vars['manager']['manager_name']; ?>
</td>
		    </tr>
		    <?php endif; ?>
		    <tr>
			<td align="right">E-Mail:</td>
			<td colspan="3"><?php if ($this->_tpl_vars['customer']['email'] != ''): ?><?php echo smarty_function_mailto(array('address' => $this->_tpl_vars['customer']['email']), $this);?>
<?php endif; ?></td>
		    </tr>
		    <tr><td colspan="4">&nbsp;</td></tr>
		</table>
	    </div>
	    <div id="contact">
		<table class="ui-widget ui-corner-top" width="75%" align="center" cellspacing="0" rules="all" style="border: solid 1px #000000;">
		    <thead class="ui-widget-header">
			<tr>
			    <th>#</th>
			    <th>ФИО</th>
			    <th>Должность</th>
			    <th>Телефон</th>
			    <th>E-Mail</th>
			    <th>Примечание</th>
			</tr>
		    </thead>
		    <tbody>
		    <?php $_from = $this->_tpl_vars['contacts']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['contacts'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['contacts']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['contact']):
        $this->_foreach['contacts']['iteration']++;
?>
			<tr>
			    <td align="center"><?php echo $this->_foreach['contacts']['iteration']; ?>
</td>
			    <td><?php echo $this->_tpl_vars['contact']['contact_name']; ?>
</td>
			    <td><?php echo $this->_tpl_vars['contact']['post']; ?>
</td>
			    <td><?php echo $this->_tpl_vars['contact']['phone_number']; ?>
</td>
			    <td><?php if ($this->_tpl_vars['contact']['email']): ?><?php echo smarty_function_mailto(array('address' => $this->_tpl_vars['contact']['email']), $this);?>
<?php else: ?>&mdash;<?php endif; ?></td>
			    <td><?php echo $this->_tpl_vars['contact']['note']; ?>
</td>
			</tr>
		    <?php endforeach; else: ?>
			<tr><td align="center" colspan="7"><i>контактов не найдено</i></td></tr>
		    <?php endif; unset($_from); ?>
		    </tbody>
		</table>
	    </div>
	    <div id="bank">

		<table width="70%">
		    <tr>
			<th>&nbsp;</th>
			<th colspan="2">Реквизиты</th>
		    </tr>
		    <tr>
			<td rowspan="8">
			    <?php if ($this->_tpl_vars['customer']['legal_home'] != 0): ?>
			    <p>
				<span>Юридический адрес:</span><br/>
				<?php echo $this->_tpl_vars['customer']['legal_index']; ?>
, <?php echo $this->_tpl_vars['customer']['legal_region']; ?>
, <?php echo $this->_tpl_vars['customer']['legal_city']; ?>
<br/>
				<?php echo $this->_tpl_vars['customer']['legal_street']; ?>
, д.<?php echo $this->_tpl_vars['customer']['legal_home']; ?>
<?php if ($this->_tpl_vars['customer']['legal_litera'] != ''): ?>-$<?php echo $this->_tpl_vars['customer']['legal_litera']; ?>
<?php endif; ?>, оф.<?php echo $this->_tpl_vars['customer']['legal_office']; ?>

			    </p>
			    <?php endif; ?>
			    <?php if ($this->_tpl_vars['customer']['actual_home'] != 0): ?>
			    <p>
				<span>Фактический адрес:</span><br/>
				<?php echo $this->_tpl_vars['customer']['actual_index']; ?>
, <?php echo $this->_tpl_vars['customer']['actual_region']; ?>
, <?php echo $this->_tpl_vars['customer']['actual_city']; ?>
<br/>
				<?php echo $this->_tpl_vars['customer']['actual_street']; ?>
, д.<?php echo $this->_tpl_vars['customer']['actual_home']; ?>
<?php if ($this->_tpl_vars['customer']['actual_litera'] != ''): ?>-$<?php echo $this->_tpl_vars['customer']['actual_litera']; ?>
<?php endif; ?>, оф.<?php echo $this->_tpl_vars['customer']['actual_office']; ?>

			    </p>
			    <?php endif; ?>
			    <?php if ($this->_tpl_vars['customer']['postal_home'] != 0): ?>
			    <p>
				<span>Почтовый адрес:</span><br/>
				<?php echo $this->_tpl_vars['customer']['postal_index']; ?>
, <?php echo $this->_tpl_vars['customer']['postal_region']; ?>
, <?php echo $this->_tpl_vars['customer']['postal_city']; ?>
<br/>
				<?php echo $this->_tpl_vars['customer']['postal_street']; ?>
, д.<?php echo $this->_tpl_vars['customer']['postal_home']; ?>
<?php if ($this->_tpl_vars['customer']['postal_litera'] != ''): ?>-$<?php echo $this->_tpl_vars['customer']['postal_litera']; ?>
<?php endif; ?>, оф.<?php echo $this->_tpl_vars['customer']['postal_office']; ?>

			    </p>
			    <?php endif; ?>
			</td>
			<?php if ($this->_tpl_vars['customer']['inn'] != 0): ?>
			<td align="right">ИНН:</td>
			<td><?php echo $this->_tpl_vars['customer']['inn']; ?>
</td>
			<?php else: ?>
			<td colspan="2">&nbsp;</td>
			<?php endif; ?>
		    </tr>
		    <?php if ($this->_tpl_vars['customer']['kpp'] != 0): ?>
		    <tr>
			<td align="right">КПП:</td>
			<td><?php echo $this->_tpl_vars['customer']['kpp']; ?>
</td>
		    </tr>
		    <?php endif; ?>
		    <?php if ($this->_tpl_vars['customer']['okpo'] != 0): ?>
		    <tr>
			<td align="right">ОКПО:</td>
			<td><?php echo $this->_tpl_vars['customer']['okpo']; ?>
</td>
		    </tr>
		    <?php endif; ?>
		    <?php if ($this->_tpl_vars['customer']['okonh'] != 0): ?>
		    <tr>
			<td align="right">ОКОНХ:</td>
			<td><?php echo $this->_tpl_vars['customer']['okonh']; ?>
</td>
		    </tr>
		    <?php endif; ?>
		    <?php if ($this->_tpl_vars['customer']['bik'] != 0): ?>
		    <tr>
			<td align="right">БИК:</td>
			<td><?php echo $this->_tpl_vars['customer']['bik']; ?>
</td>
		    </tr>
		    <?php endif; ?>
		    <?php if ($this->_tpl_vars['customer']['bank'] != ''): ?>
		    <tr>
			<td align="right">БАНК:</td>
			<td><?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['customer']['bank'])) ? $this->_run_mod_handler('sslash', true, $_tmp) : stripslashes($_tmp)))) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
</td>
		    </tr>
		    <?php endif; ?>
		    <?php if ($this->_tpl_vars['customer']['current_account'] != 0): ?>
		    <tr>
			<td align="right">Р/С:</td>
			<td><?php echo $this->_tpl_vars['customer']['current_account']; ?>
</td>
		    </tr>
		    <?php endif; ?>
		    <?php if ($this->_tpl_vars['customer']['korr_account'] != 0): ?>
		    <tr>
			<td align="right">К/С:</td>
			<td><?php echo $this->_tpl_vars['customer']['korr_account']; ?>
</td>
		    </tr>
		    <?php endif; ?>
		</table>
	    </div>
	    <div id="document">
		<div class="tabs">
		    <ul>
			<li><a href="#doc-regular">Основные</a></li>
			<li><a href="#doc-ttk">Расчётные документы</a></li>
		    </ul>
		    <div id="doc-regular">
			<table class="ui-widget" cellspacing="0" rules="all" style="border: solid 1px #000000;">
			    <thead class="ui-widget-header">
				<tr>
				    <th>Дата</th>
				    <th>Номер документа</th>
				    <th>Название документа</th>
				    <th>Файл</th>
				    <th>&nbsp;</th>
				</tr>
			    </thead>
			    <tbody class="ui-widget-content">
			    <?php $_from = $this->_tpl_vars['docs_regular']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['doc']):
?>
				<?php $this->assign('mime', ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['doc']['filename'])) ? $this->_run_mod_handler('regex_replace', true, $_tmp, '/.+\.(.+)$/', '$1') : smarty_modifier_regex_replace($_tmp, '/.+\.(.+)$/', '$1')))) ? $this->_run_mod_handler('lower', true, $_tmp) : smarty_modifier_lower($_tmp))); ?>
				<tr>
				    <td><?php echo ((is_array($_tmp=$this->_tpl_vars['doc']['document_date'])) ? $this->_run_mod_handler('date_format', true, $_tmp, '%d.%m.%Y') : smarty_modifier_date_format($_tmp, '%d.%m.%Y')); ?>
</td>
				    <td><?php echo $this->_tpl_vars['doc']['document_num']; ?>
</td>
				    <td><?php echo $this->_tpl_vars['doc']['document_name']; ?>
</td>
				    <td>
					<a href="/cgi-bin/dl.cgi?id=<?php echo $this->_tpl_vars['doc']['id']; ?>
">
					    <?php if ($this->_tpl_vars['mime'] == 'jpg' || $this->_tpl_vars['mime'] == 'gif' || $this->_tpl_vars['mime'] == 'png' || $this->_tpl_vars['mime'] == 'bmp'): ?>
					    <img src="images/icons/mimetypes/image.png" border="0"/>
					    <?php elseif ($this->_tpl_vars['mime'] == 'pdf'): ?>
					    <img src="images/icons/mimetypes/pdf-document.png" border="0"/>
					    <?php elseif ($this->_tpl_vars['mime'] == 'txt'): ?>
					    <img src="images/icons/mimetypes/txt.png" border="0"/>
					    <?php else: ?>
					    <img src="images/icons/mimetypes/unknown.png" border="0"/>
					    <?php endif; ?>
					    <?php echo $this->_tpl_vars['doc']['filename']; ?>

					</a>
					<i>(<?php echo smarty_function_math(array('equation' => 'x/1024','x' => $this->_tpl_vars['doc']['size'],'format' => '%0.2f'), $this);?>
 КБ)</i>
				    </td>
				</tr>
			    <?php endforeach; else: ?>
				<tr><td align="center" colspan="5"><i>документы не загружены</i></td></tr>
			    <?php endif; unset($_from); ?>
			    </tbody>
			</table>
		    </div>
		    <div id="doc-ttk">
			<table class="ui-widget" cellspacing="0" rules="all" style="border: solid 1px #000000;">
			    <thead class="ui-widget-header">
				<tr>
				    <th>Дата</th>
				    <th>Название документа</th>
				    <th>Файл</th>
				</tr>
			    </thead>
			    <tbody class="ui-widget-content">
			    <?php $_from = $this->_tpl_vars['docs_ttk']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['doc']):
?>
				<?php $this->assign('mime', ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['doc']['filename'])) ? $this->_run_mod_handler('regex_replace', true, $_tmp, '/.+\.(.+)$/', '$1') : smarty_modifier_regex_replace($_tmp, '/.+\.(.+)$/', '$1')))) ? $this->_run_mod_handler('lower', true, $_tmp) : smarty_modifier_lower($_tmp))); ?>
				<tr>
				    <td><?php echo ((is_array($_tmp=$this->_tpl_vars['doc']['document_date'])) ? $this->_run_mod_handler('date_format', true, $_tmp, '%d.%m.%Y') : smarty_modifier_date_format($_tmp, '%d.%m.%Y')); ?>
</td>
				    <td><?php echo $this->_tpl_vars['doc']['document_name']; ?>
</td>
				    <td>
					<a href="/cgi-bin/dl.cgi?id=<?php echo $this->_tpl_vars['doc']['id']; ?>
">
					<?php if ($this->_tpl_vars['mime'] == 'jpg' || $this->_tpl_vars['mime'] == 'gif' || $this->_tpl_vars['mime'] == 'png' || $this->_tpl_vars['mime'] == 'bmp'): ?>
					    <img src="images/icons/mimetypes/image.png" border="0"/>
					<?php elseif ($this->_tpl_vars['mime'] == 'pdf'): ?>
					    <img src="images/icons/mimetypes/pdf-document.png" border="0"/>
					<?php elseif ($this->_tpl_vars['mime'] == 'txt'): ?>
					    <img src="images/icons/mimetypes/txt.png" border="0"/>
					<?php else: ?>
					    <img src="images/icons/mimetypes/unknown.png" border="0"/>
					<?php endif; ?>
					    <?php echo $this->_tpl_vars['doc']['filename']; ?>

					</a>
					<i>(<?php echo smarty_function_math(array('equation' => 'x/1024','x' => $this->_tpl_vars['doc']['size'],'format' => '%0.2f'), $this);?>
 КБ)</i>
				    </td>
				</tr>
			    <?php endforeach; else: ?>
				<tr><td align="center" colspan="5"><i>документы не загружены</i></td></tr>
			    <?php endif; unset($_from); ?>
			    </tbody>
			</table>
		    </div>
		</div>
	    </div>
	</div>
    </body>
</html>